package cn.com.scitc.loginservlet;

import cn.com.scitc.dao.ManagerDao;
import cn.com.scitc.model.Manager;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet(name = "TestServlet",urlPatterns = "/manager/test")
public class TestServlet extends HttpServlet {
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        final ManagerDao dao = new ManagerDao();
        final Manager manager = dao.findByLoginId("19301142");

        request.getSession().setAttribute("currentUser",manager);
        response.sendRedirect("./home");
    }
}
